package com.gardenguell.salad.data.model;

import com.gardenguell.salad.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by absurd on 16/2/12.
 */
public class Vegetable extends BaseModel{

    private int mId;

    private int mImage;

    private String mName;

    private String mDescription;

    public Vegetable(int id, int image, String name){
        this.mId = id;
        this.mImage = image;
        this.mName = name;
    }

    public Vegetable(int id, int image, String name, String description){
        this.mId = id;
        this.mImage = image;
        this.mName = name;
        this.mDescription = description;
    }


    public void setId(int id) {
        this.mId = id;
    }

    public int getId(){
        return mId;
    }

    public void setImage(int image){
        this.mImage = image;
    }

    public int getImage(){
        return mImage;
    }

    public void setName(String name){
        this.mName = name;
    }

    public String getName(){
        return mName;
    }

    public void setDescription(String description){
        this.mDescription = description;
    }

    public String getDescription(){
        return mDescription;
    }

    public static Vegetable getVegetableFromId(int id){
        List<Vegetable> list = Vegetable.getVegetableList();
        if(id > list.size() || id < 1){
            return null;
        }
        return list.get(id-1);
    }

    public static List<Vegetable> getVegetableList(){
        List<Vegetable> data = new ArrayList<>();
        data.add(new Vegetable(1, R.mipmap.bocai, "菠菜"));
        data.add(new Vegetable(2, R.mipmap.caixin, "菜心"));
        data.add(new Vegetable(3, R.mipmap.jielan, "芥蓝"));
        data.add(new Vegetable(4, R.mipmap.jimaocai, "鸡毛菜"));
        data.add(new Vegetable(5, R.mipmap.kongxincai, "空心菜"));
        data.add(new Vegetable(6, R.mipmap.kuju, "苦苣"));
        data.add(new Vegetable(7, R.mipmap.luole, "罗勒"));
        data.add(new Vegetable(8, R.mipmap.tonghao, "茼蒿"));
        data.add(new Vegetable(9, R.mipmap.kongxincai, "空心菜"));
        data.add(new Vegetable(10, R.mipmap.xiangcai, "香菜"));
        data.add(new Vegetable(11, R.mipmap.xiaohongluobo, "小红萝卜"));
        data.add(new Vegetable(12, R.mipmap.youcai, "油菜"));
        return data;
    }

}
